package cn.com.ejiakanghu.goods.dto;

import org.linlinjava.litemall.db.domain.LitemallGoods;
import org.linlinjava.litemall.db.vo.app.StoreGoodsVo;
import org.omg.CORBA.PUBLIC_MEMBER;

/**
 * @author houzb
 * @Description
 * @create 2021-04-14 21:28
 */
public class GoodsPriceInfo {
    /**
     * 商品价格，精确到分，例如：18.00
     */
    private double price;
    /**
     * 显示价格后缀，例如:/天起，/元起(可选项)
     */
    private String suffix = "";
    /**
     * 显示划线价格，精确到分，例如:22.00(可选项)
     */
    private double linePrice;
    /**
     * 商品预付金（押金/租金）价格，精确到分，例如：398.00（租赁商品必须有该参数）
     */
    private double deposit;

    public GoodsPriceInfo(){}
    public GoodsPriceInfo(LitemallGoods goods) {
        this.price = goods.getCounterPrice().doubleValue();
        this.linePrice = goods.getRetailPrice().doubleValue();
        this.suffix = goods.getUnit();
        this.deposit = goods.getDeposit().doubleValue();
    }

    public GoodsPriceInfo(StoreGoodsVo storeGoods) {
        this.price = storeGoods.getSaleRetailPrice()!=null?storeGoods.getSaleRetailPrice().doubleValue():0;
        this.linePrice = storeGoods.getRetailPrice()!=null?storeGoods.getRetailPrice().doubleValue():0;
        this.suffix = storeGoods.getUnit();
        this.deposit = storeGoods.getLeaseDeposit().doubleValue();
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    public double getLinePrice() {
        return linePrice;
    }

    public void setLinePrice(double linePrice) {
        this.linePrice = linePrice;
    }

    public double getDeposit() {
        return deposit;
    }

    public void setDeposit(double deposit) {
        this.deposit = deposit;
    }
}
